Aphelion Git
Mirrored from https://git.symlinx.net/pkgit synced 22h ago
-─
<div align="center">
<h1>pkgit</h1>
(package it!)
</div>
What is this?
pkgit is an unconventional package manager designed to compile & install packages directly from their git repository.
License
pkgit is licensed under the GNU-GPL-2.0-or-later.
if you did not get a copy, please see <https://www.gnu.org/licenses/>.
│ [DISCLAIMER] Due to the nature of pkgit, you are solely responsible for vetting the repos that
│ you add to your system. Use at your own risk.
Compile pkgit
Enter the project directory, and follow one of the following procedures.
Using Make
T282828
make
Using pkgit
T282828
pkgit --build
Both methods will create an executable in the root directory of the project.
You'll probably also want to generate a base configuration file if you don't already have one.
Run this as a user to generate the config in ~/.config/pkgit:
T282828
make defconfig
You can also run this with root using sudo/doas to genereate the config in /etc/pkgit
T282828
sudo make defconfig
Install pkgit
After compiling, run the following with root privilages:
T282828
make install
Don't have root?
You can specify any install location with T383838PREFIX=<path>. A popular option is T383838~/.local:
T282828
make install PREFIX="~/.local"
Usage
Command Syntax
The structure in which you type commands into pkgit is very standard:
T282828
pkgit [--flag|-f] <package>
Flags have two types; long, and short.
The short type of each command uses the first letter of its long counterpart.
For example:
Long: T383838pkgit --install
Short: T383838pkgit -i
If you use the short version of commands,
you can chain them together into one argument:
T282828
pkgit -qif <package>
This example uses the T383838--quiet, T383838--install, and T383838--force flags to:
--quiet: minimize logs to stdout
--install: install a package
--force: even if already installed, will force the package to be installed
Installing Packages
Pre-installation
Before you use any programs that you installed with pkgit,
you need to specify the path of the binaries in your shell's configuration.
For most users, this is the command:
T282828
export PATH="$HOME/.local/bin:$PATH"
or for fish users:
T282828
fish_add_path $HOME/.local/bin
or for csh users:
T282828
setenv PATH $HOME/.local/bin:$PATH
Basic install
Assuming you have already added its respective repo, you can install a package by specifying its name:
T282828
pkgit --install [pkg_name]
Or you can use the short command:
T282828
pkgit -i [pkg_name]
Specific version install
You can specify a version of any package based on its tags with '@' separating the name from the version:
T282828
pkgit --install [pkg_name]@[version]
Specific target install
You can specify a target of any package based on its configuration in bldit.lua or init.lua with ',' separating the name from the target:
T282828
pkgit --install [pkg_name],[target]
Combined target and version install
You can specify both the target and the version of any package you install in the same command (order does not matter as long as the package name is first):
T282828
pkgit --install [pkg_name],[target]@[version]
T282828
pkgit --install [pkg_name]@[version],[target]
Repo install
If you haven't added the package's repository yet, or you just want to be specific, you can install the package using its git URL:
T282828
pkgit --install [url.git]
This also works with the target and version syntax.
Local install
If you want to install a package from a local code repository,
and want to take advantage of pkgit's build system autodetection,
you can enter that repository's root directory and install it from there:
T282828
pkgit --install .
Building packages
FOR DEVELOPERS
You can also use pkgit as a sort of meta-build-system to automatically compile any supported project with the build command:
T282828
pkgit --build [/path/to/project]
This can also be done without specifying the path (T383838pkgit --build) if you're in the project's root directory
Removing Packages
Removing (uninstalling) a package is as simple as it seems:
T282828
pkgit --remove [pkg_name]
Or the short command:
T282828
pkgit -r [pkg_name]
Updating Packages
You can easily update your installed packages by running:
T282828
pkgit --update
Or the short command:
T282828
pkgit -u
Declaring Packages
If you prefer a declarative approach, you can use the config file (read below) as a package declaration file.
When you're ready, you can declare all your packages at once with:
T282828
pkgit --declare
Or the short command:
T282828
pkgit -d
Dependency Management
As it is, pkgit is capable of dependency management, but you will likely have to specify the dependency URLs for each package you install in T383838<config_directory>/pkgit/init.lua.
There's not a universal way to check for dependencies without using an existing package manager (unless the package you're installing has a bldit.lua).
Configuring pkgit
Thankfully, this is a very simple process.
To configure pkgit, you have one centralized configuration file: T383838<config_directory>/pkgit/init.lua
Thanks to liblua, pkgit pushes a package.path variable directly to your configuration file.
This means that you can require any sub-file/directory, without wrestling with T383838require().
The overall structure of the configuration file is explained in detail in T383838config/init.lua
[DEVELOPER]: bldit.lua
If you want your own package's dependencies, version, compilation,
and other aspects to be properly resolved in pkgit, you can create a
T383838bldit.lua file in the root directory of your project's git repo.
Do not name it anything other than T383838bldit.lua, otherwise pkgit
will not find the file.
A great example for T383838bldit.lua is right here in the pkgit repository!
Check it out if you want to know how it's structured.
Contributing to pkgit
If you want to contribute to pkgit, please refer to CONTRIBUTING.md
Served by rngit 1.3.8 - Generated in 0.08s